using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.Admin.Data;

using AddressGroupTable = CentralOffice.Admin.Data.AddressDataSet.addressgroupDataTable;
using AddressGroupRow = CentralOffice.Admin.Data.AddressDataSet.addressgroupRow;
namespace CentralOffice.Admin.DataAccess
{
    public class AddressGroupAdapter : DataAccessAdapter<Admin.Data.AddressDataSet, AddressGroupTable, AddressGroupRow>
    {
        public AddressGroupAdapter()
        {

            this.TableName = "addressgroup";
            DeleteStoredProc = "AddressGroup_DeleteAddressGroup";

            GetAllStoredProc = "AddressGroup_SelectAddressGroupAll";
            InsertStoredProc = "AddressGroup_InsertAddressGroup";
            UpdateStoredProc = "AddressGroup_UpdateAddressGroup";
            FindStoredProc = "AddressGroup_SelectAddressGroupDynamic";
            GetByIdStoredProc = "AddressGroup_SelectAddressGroup";
            GetPagedStoredProc = "AddressGroup_SelectAddressGroupPaged";
            GetRowCountStoredProc = "AddressGroup_SelectAddressGroupRowCount";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "id", DbType.Guid, "id", DataRowVersion.Current);
            db.AddInParameter(cmd, "GroupName", DbType.String, "GroupName", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserId", DbType.AnsiString, "UserId", DataRowVersion.Current);
            db.AddInParameter(cmd, "PrivDept", DbType.String, "PrivDept", DataRowVersion.Current);
            db.AddInParameter(cmd, "PrivRole", DbType.String, "PrivRole", DataRowVersion.Current);
            db.AddInParameter(cmd, "PrivUser", DbType.String, "PrivUser", DataRowVersion.Current);
            db.AddInParameter(cmd, "OrderNo", DbType.Int32, "OrderNo", DataRowVersion.Current);
            db.AddInParameter(cmd, "SupportDept", DbType.String, "SupportDept", DataRowVersion.Current);
        }
    }
}
